Repository navigation
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 52 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b989032429
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…top is away The edge runs the real Ops and Work classes in the Durable Object once the laptop has been quiet for 60s, through a new edge run translator (edge/src/direct.ts): fleet gh api argv become GitHub REST calls, fleet secrets get becomes a Worker secret, and the queue store is already reached by fetch. Laptop-only verbs answer needs the laptop. Direct reads: board, prs, priorities, asks. Direct writes: ask.send, ask.reply, ask.close, issue.comment, need.comment, issue.rank, task.move. A new prompt files its issue at the edge and holds only prompt.enqueue for the laptop, which runs ops.enqueue on return; a reply posts its comment once at the edge and is never repeated. The no-twice rule stands: an action relayed with no answer is only ever resolved by the laptop. EdgeConfig gains queueDbUrl, queueTokenName, promptLabel, needsRepos. scripts/expose.py gains --edge-direct (off by default, remembered like --edge) provisioning GITHUB_TOKEN, QUEUE_TOKEN and EDGE_DIRECT; health reports the capability and an hourly self-check of one read of each kind. This supersedes the approach of PR #12548 for the PR read: its dedicated readOpenPullRequests/freshRead is replaced by Ops.prs() through the same run/fetch, so the PR read shares the one path. Tests: bun test 130 pass (was 110) — 13 direct translator tests, 6 new edge integration tests, 1 enqueue-hook test. The edge bundles: wrangler deploy --dry-run, 126.87 KiB. Refs #12518
…top is away (#12579) * pm-console: run queue and GitHub operations at the edge while the laptop is away The edge runs the real Ops and Work classes in the Durable Object once the laptop has been quiet for 60s, through a new edge run translator (edge/src/direct.ts): fleet gh api argv become GitHub REST calls, fleet secrets get becomes a Worker secret, and the queue store is already reached by fetch. Laptop-only verbs answer needs the laptop. Direct reads: board, prs, priorities, asks. Direct writes: ask.send, ask.reply, ask.close, issue.comment, need.comment, issue.rank, task.move. A new prompt files its issue at the edge and holds only prompt.enqueue for the laptop, which runs ops.enqueue on return; a reply posts its comment once at the edge and is never repeated. The no-twice rule stands: an action relayed with no answer is only ever resolved by the laptop. EdgeConfig gains queueDbUrl, queueTokenName, promptLabel, needsRepos. scripts/expose.py gains --edge-direct (off by default, remembered like --edge) provisioning GITHUB_TOKEN, QUEUE_TOKEN and EDGE_DIRECT; health reports the capability and an hourly self-check of one read of each kind. This supersedes the approach of PR #12548 for the PR read: its dedicated readOpenPullRequests/freshRead is replaced by Ops.prs() through the same run/fetch, so the PR read shares the one path. Tests: bun test 130 pass (was 110) — 13 direct translator tests, 6 new edge integration tests, 1 enqueue-hook test. The edge bundles: wrangler deploy --dry-run, 126.87 KiB. Refs #12518 * pm-console: answer Codex review on #12579 - direct.ts: send an explicit User-Agent with GitHub REST requests; Workers supplies none and GitHub requires it. - edge-proto.ts: accept configs stored or reported before direct mode (new direct fields empty); gate direct capabilities on the config carrying them instead of refusing the whole config. - edge.ts: hydrate the durable mirror before a first direct read, so a failed read after a restart keeps last-good data; keep notification refreshes from reloading the mirror over freshly read sections. - actions.ts: a failed deferred prompt.enqueue throws, so the held action is reported failed instead of recorded done with no queue task. - expose.py: remember the direct-mode choice only after the Worker has it, so a failed run retries instead of assuming the mode is set. Tests: 134/134 console tests (bun test), 19/19 expose tests; each new test fails against the pre-fix code. --------- Co-authored-by: Drewry Pope <dezren39@users.noreply.github.com>
GitHub rejects requests without a valid User-Agent, and a Cloudflare Worker sends none by default, so the direct PR read failed even with a valid token. Addresses review thread on #12548 (github.ts:22).
The ops document awaited the GitHub read (up to the 20s timeout) on every request while the laptop was silent, stalling the Next, ranked issue, agent and service views too. The read now runs in the background through the Durable Object's waitUntil, shared while one is already running, and only for a stale section, so the document answers at once from cache and the fresh list arrives on the next poll. Also in Docs.refresh: a load that finishes after a newer read must not put its older copy back, so the background record cannot be overwritten by the document's own stale-section mirror load. Addresses review threads on #12548 (edge.ts:594).
A failed GitHub read stamped the section's time before the stored copy was ever loaded, so after a Durable Object restart the PR view stayed on 'Loading...' even with a good laptop snapshot in storage: the stamped time both skipped the initial mirror load (which only runs for sections never read) and kept the 90s staleness window from ever elapsing, since the frontend polls every 20s. The failure path now reads the persisted section back first, then records the failure, so the last good list stays visible with the failure reported in its health. Addresses review thread on #12548 (edge.ts:596).
Summary
Evidence
bun test— 112 pass;npm run build— pass;git diff --check— pass.origin/maininto the branch.Merge Danger
GITHUB_READ_ENABLED=onandGITHUB_TOKENare configured; no write endpoint is added.Refs #12518
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.